Objects Reference

class bezier_curve : public base_object

Definition

class bezier_curve : public base_object
{
  public:
  float *p;
  int np,ns,dim;
  vector pivot;

  bezier_curve()
  { p=0; reset(); };
  virtual ~bezier_curve()
  { reset(); };

  void reset();
  void set_dim(int ndim);
  void add_point(float *f);
  void evaluate(float u,float *f);
  void evaluate_tangent(float u,float *f);
  int adaptative_subdiv(float maxerror,float *points,int maxpoints);
  int load_bez(char *file);
  float length();
 };

Data Members

Member Type Description
p float * array of points (np*dim floats)
np int number of points in array
ns int number of curve segments
dim int dimension for each point
pivot vector position in 3D space for the center of the curve

Methods

reset, set_dim, add_point, evaluate, evaluate_tangent, adaptative_subdiv, load_bez, length

Remarks

This class implements a Bezier curve of any dimension (1D, 2D, 3D, etc...).

The curve and tangent can be evaluated at any point, and the curve can be adaptively subdivided until the curve error is less then a maximum error factor.

See Also

vector, bezier_patch